<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <link rel="stylesheet" href="/css/app.css">
</head>
<body>
<from>
<div class="container">
    <nav class="navbar navbar-expand-lg navbar-dark bg-dark">
        <a class="navbar-brand" href="{{route('index')}}">laravel</a>
        <div class="collapse navbar-collapse" id="navbarSupportedContent">
            <ul class="navbar-nav mr-auto">
                <li class="nav-item active">
                    <a class="nav-link" href="{{route('user.index')}}">皮，真的皮！</a>
                </li>
            </ul>
            {{--laravel框架提供了Auth类的用户认证，如果成功，会自动保存当前用户数据
               所以我们需要用Auth类中获取当前已经认证过的用户数据来进行判断--}}
            @if(Auth::check())
                {{--{{Auth::user()->name}} 显示当前用户名--}}
                <a href="{{route('password')}}" class="btn btn-danger my-2 my-sm-0 mr-2 ">{{Auth::user()->name}}</a>
                <a href="{{route('logout')}}" class="btn btn-success my-2 my-sm-0">退出登录</a>
            @else
                <a href="{{route('regist')}}" class="btn btn-danger my-2 my-sm-0 mr-2 ">注册</a>
                <a href="{{route('login')}}" class="btn btn-success my-2 my-sm-0">登录</a>
                @endif
                </form>
        </div>
    </nav>

    @include('public.message')
    {{--占位符--}}
    @yield('content')

</div>
</body>
</html>